module.exports = (req, res, next)=>{
  res.er = (err, code=1)=>{
    res.send({
      code,
      msg: err instanceof Error? err.message : err
    })
  }
  next()
}